#!/usr/bin/env python2
#-*-coding=utf-8-*-


if __name__ == '__main__':
    choice = raw_input('a：计算面积。b：计算体积。：')
    while choice != 'a' and choice != 'b':
        choice = raw_input('a：计算面积。b：计算体积。：')
    if choice == 'a':
        choice = raw_input('c：圆形。d：正方形。')
        if choice == 'c':
            num = raw_input('输入半径：')
            print 3.1415 * (float(num) ** 2)
        elif choice == 'd':
            num = raw_input('输入边长：')
            print float(num) ** 2
    elif choice == 'b':
        choice = raw_input('c：球形。d：立方体。')
        if choice == 'c':
            num = raw_input('输入半径：')
            print 4/3 * (float(num) ** 3)
        elif choice == 'd':
            num = raw_input('输入边长：')
            print float(num) ** 3
